unit ResourceManagerI;

interface
const
ResourceManagerGUID :TGUID = '{A9EFB99F-D1A4-4D54-92F3-86DE21277F9B}';
ResourceMakerGUID:TGUID = '{EA0BD78C-C993-4B22-9544-D801886806A6}';

//resource types
RT_Unknown=0;
RT_Index = 1;
RT_3DSound=2;
RT_2DSound=3;
RT_Script = 4;
RT_String=5;
Type TResourceType = cardinal;
TResourceInitializerFunc = function(const RawData:pointer; const RawDataSize:cardinal; var FreeRawData:boolean; const ResName:PChar):pointer; cdecl;
TResourceFreeFunc = Procedure(Data:pointer); cdecl;
type IResourceManager=^_ResourceManager;
_ResourceManager = packed record
AddResourceHandler:Procedure(const ResType:TResourceType; const Init:TResourceInitializerFunc;
const Free:TResourceFreeFunc); cdecl;
LoadPackage:Procedure(const name:PChar; const initResources:boolean=true); cdecl;
UnloadPackage:Procedure(const name:PChar); cdecl;
SavePackage:Procedure(const name:PChar; const standalone:boolean); cdecl;
GetResource:Function(const FullName:PChar; const ResType:TResourceType=RT_Unknown):pointer; cdecl;
GetResourceData:Function(const res:pointer):pointer; cdecl;
GetResourceSize:Function(const res:pointer):cardinal; cdecl;
GetResourceType:Function(const res:pointer):TResourceType;
AddResource:function(const package,ResourceName,FileName:PChar; const ResType:TResourceType):pointer; cdecl;
GetParamsCount:Function(const r:pointer):integer; cdecl;
AddParam:procedure(const r:pointer; const paramName,ParamValue:PChar); cdecl;
end;

implementation

end.
